package framework.fault;

import framework.grid.NodePeer;
import framework.grid.data.IRemoteNodeData;
import framework.grid.data.IRemoteNodeMetaData;

import java.rmi.Remote;
import java.rmi.RemoteException;

public interface IFaultTolerantPeer extends Remote {
	public enum Side {LEFT, RIGHT}
	
	public IRemoteNodeData createRemoteNodeData() throws RemoteException;
	public IRemoteNodeMetaData createRemoteNodeMetaData() throws RemoteException;

	public boolean join(IFaultTolerantPeer joiningPeer) throws RemoteException;
	public boolean setLeft(IFaultTolerantPeer peer) throws RemoteException;
	public boolean setRight (IFaultTolerantPeer peer) throws RemoteException;
	public boolean reConnect(Side side, IFaultTolerantPeer peer, boolean forceConnect) throws RemoteException;
	
	public void resetState() throws RemoteException;
	public void resetRefs() throws RemoteException;
	
	public NodePeer getDataNode() throws RemoteException;
	public IFaultDetectionPeer getFaultNode() throws RemoteException;
	
	public String getName() throws RemoteException;

}

